<?php
namespace app\index\model;
use think\Model;
use think\Db;
// 子单数据库
class Orders extends model{
	function findsid($id){

		$res = db("Orders")->alias('o')->where("o.uid",$id)->limit(10)->join('ordered oe','o.order_id = oe.id')->field('oe.times,o.*')->order("o.id desc")->select();
		foreach ($res as $key => $va) {
			$s = model("rate")->zhaorate($va['bet'],$va['colums'],$va['bets']);
			$res[$key]["name"] = $s['name'];
		}
		return $res;
	}
}